<?php

class OOWP_Atom_WP
    extends OOWP_Formattable
{

    public function __construct($mode)
    {
        if (in_array($mode, array('footer', 'head'))) {
            $this->dict['mode'] = $mode;
        } else {
            $this->dict['mode'] = 'head';
        }
    }

    protected function getMode( )
    {
        return $this->dict['mode'];
    }

    protected function getFormatPieces( )
    {
        $command = 'wp_' . $this->mode;
        ob_start( );
        $command( );
        $capture = ob_get_contents();
        ob_end_clean();

        $result = explode("\n", $capture);
        return array_filter($result, "strlen");
    }

}
